﻿using wwl.Contract.Dtos.Common;
using wwl.Contract.Dtos.Requests.Rbac;
using wwl.Contract.Interfaces.Common;
using wwl.Domain.Entities.Rbac;

namespace wwl.Contract.Interfaces.Rbac
{
  /// <summary>
  /// 用户仓储接口
  /// 继承通用仓储接口，扩展用户专属数据操作契约
  /// </summary>
  public interface IUserRepository : IGenericRepository<User>
  {
    /// <summary>
    /// 根据用户名查询用户
    /// </summary>
    Task<User?> GetByUsernameAsync(string username);

    /// <summary>
    /// 检查用户名是否存在
    /// </summary>
    Task<bool> ExistsByUsernameAsync(string username, string? excludeId = null);

    /// <summary>
    /// 检查邮箱是否存在
    /// </summary>
    Task<bool> ExistsByEmailAsync(string email, string? excludeId = null);

    /// <summary>
    /// 用户分页查询
    /// </summary>
    Task<PagedResult<User>> GetPagedAsync(UserPagedRequest request);
  }
}